package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) RoleCreate(ctx context.Context, req *system.RoleCreateReq) (res *system.RoleCreateRes, err error) {
	res = new(system.RoleCreateRes)
	res.Id, err = service.SystemRole().Create(ctx, model.SystemRoleCreateInput{
		Code: req.Code,
		Name: req.Name,
	})
	return res, err
}
